<template>
  <router-view></router-view>
</template>
<script>
import { getProjectList,getOrg } from '../api/commom'
import { useStore } from 'vuex'

export default {
  name: 'contract-manage',
  created() {
    const store = useStore()
    console.log(this, 'this')
    if (store.state.projectCenter.orgList.length == 0) {
      getOrg().then((res) => {
        store.state.projectCenter.orgList = res.data.data
        ergodicOrg(store.state.projectCenter.orgList)
        console.log(store.state.projectCenter.orgList, 'store.state.projectCenter.orgList')
      })
    }
    const ergodicOrg = (orgList) => {
      orgList.forEach((element) => {
        element.label = element.name
        element.value = element.id
        if (element.children) {
          ergodicOrg(element.children)
        }
      })
    }
  },
}
</script>
